package cn.nn200433.mqtt.service.impl;

import cn.nn200433.mqtt.config.MqttClientProperties;
import cn.nn200433.mqtt.core.MsgLogUtil;
import cn.nn200433.mqtt.service.IMqttHandlerService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttMessage;

/**
 * 默认mqtt处理程序服务实现
 *
 * @author nn200433
 * @date 2022-06-28 028 10:31:57
 */
@Slf4j
public class DefaultMqttHandlerServiceImpl implements IMqttHandlerService {
    
    @Override
    public String getSubscribeTopic() {
        return "default";
    }
    
    @Override
    public void subscribeMsgArrivedHandle(MqttClientProperties mqttConfig, String topic, MqttMessage message)
            throws Exception {
        MsgLogUtil.debug(topic, message.getQos(), message);
    }
    
}
